{block name=body}
{* Define the function *} {function name=options_list level=0} 
	{foreach $opts as $opt}
		{if $level eq 0}
			<optgroup label="{$opt.value}">
		{else}
			<option value="{$opt.id}" {if $selected eq $opt.id}selected="selected"{/if}>{$opt.value}</option>
		{/if}
		{if count($opt.subs) > 0} {call name=options_list opts=$opt.subs level=$level+1 } {/if} 
	{/foreach} 
{/function}

<div id="partycont">
	<div class="container">
		<div class="row">
			<div class="col-sm-{if $listing_image}8{else}12{/if}">
				<div class="visible-md visible-lg">
					{include file='breadcrumbs.tpl'} 
				</div>
			
	  			<h2 class="title" id="partytitle">{$listing_name}</h2>
				  			
	  			{$listing_content1}
			</div>
			{if $listing_image}
				<div class="col-sm-4 hidden-xs">
  				<img src="{$listing_image}?width=370" alt="{$listing_name} image" class="img-responsive padtop" />
				</div>
			{/if}
		</div>
	</div>
</div>
	
<div class="container pagecont">	
		<div class="row">
			<div id="maintext" class="col-sm-12">
				{$listing_content2}
			</div>
		</div>
</div>

{if $listing_content3}
	<div class="bluebg">
		<div class="container">
			<div class="row">
				<div class="col-sm-12">
					{$listing_content3}
				</div>
			</div>
		</div>
	</div>
{/if}

{if $listing_content4}	
	<div class="container pagecont">
		<div class="row">
			<div class="col-sm-12">
				{$listing_content4}
			</div>
		</div>
	</div>
{/if}


<div id="enroltrialhead">
	<div class="container">
		<div class="row">
			<div class="col-sm-12 text-center"><a name="elcform"></a>
				Enquire about ELC &amp; Kinder
			</div>
		</div>
	</div>
</div>

<div id="enroltrialmain">
	<div class="container">
		<div class="row">
			<div class="col-sm-8 col-sm-offset-2">
			<div class="row">
				{if $error}
					<div id="error" class="alert alert-danger fade in text-center">
						<button class="close" aria-hidden="true" data-dismiss="alert" type="button">&times;</button>
						<strong class="text-danger">{$error}</strong>
					</div>
				{/if}
			<form id="franchise_form" method="post" action="/process/contact-us" novalidate="novalidate">
			
					<div class="col-sm-6 form-group">
						<label for="name">Your name*:</label>
						<input type="text" id="name" name="name" value="{if $post}{$post.name}{else}{$user.gname} {$user.surname}{/if}" required />
					</div>
					
					<div class="col-sm-6 form-group">
						<label for="schoolname">School name*:</label>
						<input type="text" id="schoolname" name="schoolname" value="{if $post}{$post.schoolname}{/if}" required />
					</div>
					
					<div class="col-sm-6 form-group">
						<label for="email">Email*:</label>
						<input type="email" id="email" name="email" value="{if $post}{$post.email}{else}{$user.email}{/if}" required />
					</div>
					
					<div class="col-sm-6 form-group">
						<label for="phone">Phone*:</label>
						<input type="text" id="phone" name="phone" value="{if $post}{$post.phone}{else}{$address.S.address_telephone}{/if}" required />
					</div>
					
					<div class="col-sm-6 form-group">
						<label for="postcode">Postcode*:</label>
						<input type="text" id="postcode" name="postcode" value="{if $post}{$post.postcode}{else}{$address.S.address_postcode}{/if}" pattern="[0-9]" required />
					</div>
					
					<div class="col-sm-6 form-group" id="hearcont">
						<label for="hearabout">How did you hear about us?*</label>
						<div>
						<select id="hearabout"  tabindex="0" class="required" name="hear_about_us">
							<option value="">Please select</option>
								{if $post}{assign var='selected' value=$post.hear_about_us}{else}{assign var='selected' value=$user.user_hearabout}{/if}
								{call name=options_list opts=$hearabout selected=$selected}
						</select>
						</div>
					</div>
		            
					<div class="col-sm-12 form-group">
						<label for="enquiry">Enquiry:</label>
						<textarea id="enquiry" name="enquiry">{if $post}{$post.enquiry}{/if}</textarea>
					</div>
		
					<div class="col-sm-12 form-group hide">
						<label for="additional">Additional info:</label>
						<input type="text" id="additional" name="additional" value="" >
						<input type="hidden" id="reference_page" name="reference_page" value="{$listing_name}" >
						<input type="hidden" id="reference_page_objid" name="reference_page_objid" value="{$listing_object_id}" >
						<input type="hidden" id="token" name="formToken" value="{$token}" >
					</div>
			<div class="col-sm-12">
				<button class="enquire" type="submit"><span>Enquire now</span></button>
			</div>
			
			</form>
			</div>
			
			</div>
		</div>
	</div>
</div>


<div id="helpblock">
<div class="top">
	<img src="/images/helpcircle.png" alt="" />
</div>

<div class="container">
	<div class="row">
		<div class="col-sm-12 text-center">
			<span class="vanish">Need help?</span> <span class="vanish">Call <a href="tel://{$PHONE}">{$PHONE}</a></span> <span class="vanish">or <a href="/contact-us#form">email us now</a>!</span>
		</div>
	</div>
</div>
</div>
{/block}

{block name=tail}
<script type="text/javascript">
$(function(){
	$('select').selectBoxIt();
});	
$(document).ready(function(){
	 	$('#franchise_form').validate();
	 	
	 	$('#postcode').rules("add", {
			digits: true,
			minlength: 4
		});

	 	$('#email').rules("add", {
			email: true
		});
 	  
});
</script>
{/block}
